﻿using System;
using System.Drawing;

namespace YRevitJig
{
	public class XLine2D : XDrawable2D, ICloneable
	{
		public XLine2D()
		{
			this.PointStart = System.Drawing.Point.Empty;
			this.PointEnd = System.Drawing.Point.Empty;
		}

		public XLine2D(System.Drawing.Point ptStart, Point ptEnd)
		{
			this.PointStart = ptStart;
			this.PointEnd = ptEnd;
		}

		public override void Draw(XGraphics g)
		{
			try
			{
				g.m_graphics.DrawLine(g.m_pen, this.PointStart, this.PointEnd);
			}
			catch
			{
			}
		}

		public object Clone()
		{
			try
			{
				return new XLine2D(this.PointStart, this.PointEnd);
			}
			catch
			{
			}
			return null;
		}

		public Point PointStart { get; set; }

		public Point PointEnd { get; set; }
	}
}
